﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="Web.View.b00_zjmxMenu.Default" %>
<%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %> 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>b00_zjmx</title>
    <script src="/View/js/Alert.js" type="text/javascript"></script> 
    <script type="text/javascript">
        function SetWinData(index) {
            document.getElementById("Hid").value = b00_zjmx_MainStore.getAt(index).get('fundid');
            
			Txtareacode.setValue(b00_zjmx_MainStore.getAt(index).get('areacode'));
			Txtyearfen.setValue(b00_zjmx_MainStore.getAt(index).get('yearfen'));
			Txtraiseatub.setValue(b00_zjmx_MainStore.getAt(index).get('raiseatub'));
			Txtcenteradj.setValue(b00_zjmx_MainStore.getAt(index).get('centeradj'));
			Txtprovinceadj.setValue(b00_zjmx_MainStore.getAt(index).get('provinceadj'));
			Txtcityadj.setValue(b00_zjmx_MainStore.getAt(index).get('cityadj'));
			Txtcountyadj.setValue(b00_zjmx_MainStore.getAt(index).get('countyadj'));
			Txttownadj.setValue(b00_zjmx_MainStore.getAt(index).get('townadj'));
			Txtfarmerpay.setValue(b00_zjmx_MainStore.getAt(index).get('farmerpay'));
			Txtmzadj.setValue(b00_zjmx_MainStore.getAt(index).get('mzadj'));
			Txtcollectadj.setValue(b00_zjmx_MainStore.getAt(index).get('collectadj'));
			Txtotheradj.setValue(b00_zjmx_MainStore.getAt(index).get('otheradj'));
			Txtsumjy.setValue(b00_zjmx_MainStore.getAt(index).get('sumjy'));
			Txtdoorjy.setValue(b00_zjmx_MainStore.getAt(index).get('doorjy'));
			Txthosjy.setValue(b00_zjmx_MainStore.getAt(index).get('hosjy'));
			Txtbigilljy.setValue(b00_zjmx_MainStore.getAt(index).get('bigilljy'));
			Txtriskjy.setValue(b00_zjmx_MainStore.getAt(index).get('riskjy'));
			Txtyearjy.setValue(b00_zjmx_MainStore.getAt(index).get('yearjy'));
			Txtyeardoorjy.setValue(b00_zjmx_MainStore.getAt(index).get('yeardoorjy'));
			Txtyearbigjy.setValue(b00_zjmx_MainStore.getAt(index).get('yearbigjy'));
			Txtyearhosjy.setValue(b00_zjmx_MainStore.getAt(index).get('yearhosjy'));
			Txtyearriskjy.setValue(b00_zjmx_MainStore.getAt(index).get('yearriskjy'));
			Txtlastyearsum.setValue(b00_zjmx_MainStore.getAt(index).get('lastyearsum'));
			Txtyearoutsum.setValue(b00_zjmx_MainStore.getAt(index).get('yearoutsum'));
			Txtstate.setValue(b00_zjmx_MainStore.getAt(index).get('state'));
			Txtdqbm.setValue(b00_zjmx_MainStore.getAt(index).get('dqbm'));

            b00_zjmx_Win.show();
        }
    </script>
</head>
<body>
    <form id="MainForm" runat="server">
    <ext:ResourceManager ID="MainResourceMgr" runat="server" />
    <!--用来导出到Excel的数据源-->
    <ext:Hidden ID="ExcelGridData" runat="server" />
    <!--b00_zjmx表页面主数据元，自动生成-->
    <ext:Store runat="server" ID="b00_zjmx_MainStore" OnRefreshData="b00_zjmx_DataBind" AutoLoad="true">
        <Proxy>
            <ext:PageProxy />
        </Proxy>
        <Reader>
            <ext:JsonReader IDProperty="fundid">
                <Fields>
                    
					<ext:RecordField Name="fundid" />
					<ext:RecordField Name="areacode" />
					<ext:RecordField Name="yearfen" />
					<ext:RecordField Name="raiseatub" />
					<ext:RecordField Name="centeradj" />
					<ext:RecordField Name="provinceadj" />
					<ext:RecordField Name="cityadj" />
					<ext:RecordField Name="countyadj" />
					<ext:RecordField Name="townadj" />
					<ext:RecordField Name="farmerpay" />
					<ext:RecordField Name="mzadj" />
					<ext:RecordField Name="collectadj" />
					<ext:RecordField Name="otheradj" />
					<ext:RecordField Name="sumjy" />
					<ext:RecordField Name="doorjy" />
					<ext:RecordField Name="hosjy" />
					<ext:RecordField Name="bigilljy" />
					<ext:RecordField Name="riskjy" />
					<ext:RecordField Name="yearjy" />
					<ext:RecordField Name="yeardoorjy" />
					<ext:RecordField Name="yearbigjy" />
					<ext:RecordField Name="yearhosjy" />
					<ext:RecordField Name="yearriskjy" />
					<ext:RecordField Name="lastyearsum" />
					<ext:RecordField Name="yearoutsum" />
					<ext:RecordField Name="state" />
					<ext:RecordField Name="dqbm" />

                </Fields>
            </ext:JsonReader>
        </Reader> 
        <BaseParams>
            <ext:Parameter Name="start" Value="0" Mode="Raw">
            </ext:Parameter>
            <ext:Parameter Name="limit" Value="15" Mode="Raw">
            </ext:Parameter>
        </BaseParams>
    </ext:Store>
    <!--b00_zjmx页面主表格-->
    <ext:Viewport ID="MainViewPort" runat="server">
        <Items>
            <ext:FitLayout>
                <Items>
                    <ext:GridPanel ID="b00_zjmx_Grid" Layout="fit" TrackMouseOver="true" runat="server" StoreID="b00_zjmx_MainStore"
                        StripeRows="true" Header="false" Border="false" Collapsible="true">
                        <TopBar>
                            <ext:Toolbar ID="MainToolBar" runat="server">
                                <Items>
                                    <ext:Button ID="BtnAdd" runat="server" Text="添加" Icon="Add">
                                        <Listeners>
                                            <Click Handler="#{b00_zjmx_MainForm}.getForm().reset();#{Hid}.setValue('');#{b00_zjmx_Win}.show();" />
                                        </Listeners>
                                    </ext:Button>
                                    <ext:Button ID="BtnDel" runat="server" Text="删除" Icon="Delete">
                                        <DirectEvents>
                                            <Click OnEvent="BtnDel_Click">
                                                <Confirmation ConfirmRequest="true" Title="确认" Message="确实要删除吗?" />
                                                <EventMask ShowMask="true" Msg="正在删除数据，请等候 ..." />
                                            </Click>
                                        </DirectEvents>
                                        <Listeners>
                                            <Click Handler="if(#{b00_zjmx_Grid}.getSelectionModel().getCount()<=0) {TellAlert('请选择要删除的记录');return false;}" />
                                        </Listeners>
                                    </ext:Button>
                                    <ext:ToolbarSeparator />
                                    <ext:Button ID="BtnReload" runat="server" Text="重新加载" Icon="Reload">
                                        <Listeners>
                                            <Click Handler="#{b00_zjmx_MainStore}.reload();" />
                                        </Listeners>
                                    </ext:Button>
                                    <ext:ToolbarFill />
                                    <ext:Button ID="BtnToExcel" runat="server" Text="To Excel" AutoPostBack="true" OnClick="BtnSaveToExcel"
                                        Icon="PageExcel">
                                        <Listeners>
                                            <Click Handler="#{ExcelGridData}.setValue(Ext.encode(b00_zjmx_Grid.getRowsValues(false)));" />
                                        </Listeners>
                                        <ToolTips>
                                            <ext:ToolTip Title="将当前页内容存储为Excel文件">
                                            </ext:ToolTip>
                                        </ToolTips>
                                    </ext:Button>
                                </Items>
                            </ext:Toolbar>
                        </TopBar>
                        <ColumnModel ID="b00_zjmx_ColumnMode" runat="server">
                            <Columns>
                                <ext:RowNumbererColumn Width="20" />
                                <ext:Column Header="主键" Sortable="true" Hidden="true" DataIndex="fundid" />
                                
								<ext:Column Header="AreaCode" Sortable="true" DataIndex="areacode" />
								<ext:Column Header="YearFen" Sortable="true" DataIndex="yearfen" />
								<ext:Column Header="RaiseAtub" Sortable="true" DataIndex="raiseatub" />
								<ext:Column Header="CenterAdj" Sortable="true" DataIndex="centeradj" />
								<ext:Column Header="ProvinceAdj" Sortable="true" DataIndex="provinceadj" />
								<ext:Column Header="CityAdj" Sortable="true" DataIndex="cityadj" />
								<ext:Column Header="CountyAdj" Sortable="true" DataIndex="countyadj" />
								<ext:Column Header="TownAdj" Sortable="true" DataIndex="townadj" />
								<ext:Column Header="FarmerPay" Sortable="true" DataIndex="farmerpay" />
								<ext:Column Header="MZAdj" Sortable="true" DataIndex="mzadj" />
								<ext:Column Header="CollectAdj" Sortable="true" DataIndex="collectadj" />
								<ext:Column Header="OtherAdj" Sortable="true" DataIndex="otheradj" />
								<ext:Column Header="SumJY" Sortable="true" DataIndex="sumjy" />
								<ext:Column Header="DoorJY" Sortable="true" DataIndex="doorjy" />
								<ext:Column Header="HosJy" Sortable="true" DataIndex="hosjy" />
								<ext:Column Header="BigIllJy" Sortable="true" DataIndex="bigilljy" />
								<ext:Column Header="RiskJY" Sortable="true" DataIndex="riskjy" />
								<ext:Column Header="YearJY" Sortable="true" DataIndex="yearjy" />
								<ext:Column Header="YearDoorJY" Sortable="true" DataIndex="yeardoorjy" />
								<ext:Column Header="YearBigJy" Sortable="true" DataIndex="yearbigjy" />
								<ext:Column Header="YearHosJy" Sortable="true" DataIndex="yearhosjy" />
								<ext:Column Header="YearRiskJY" Sortable="true" DataIndex="yearriskjy" />
								<ext:Column Header="LastYearSum" Sortable="true" DataIndex="lastyearsum" />
								<ext:Column Header="YearOutSum" Sortable="true" DataIndex="yearoutsum" />
								<ext:Column Header="State" Sortable="true" DataIndex="state" />
								<ext:Column Header="dqbm" Sortable="true" DataIndex="dqbm" />

                            </Columns>
                        </ColumnModel>
                        <Listeners>
                            <RowDblClick Handler="SetWinData(rowIndex);" />
                        </Listeners>
                        <Plugins>
                            <ext:GridFilters runat="server" FiltersText="查找" ID="b00_zjmx_Filter">
                                <Filters>
                                    
								<ext:StringFilter DataIndex="areacode" />
								<ext:StringFilter DataIndex="yearfen" />
								<ext:StringFilter DataIndex="raiseatub" />
								<ext:StringFilter DataIndex="centeradj" />
								<ext:StringFilter DataIndex="provinceadj" />
								<ext:StringFilter DataIndex="cityadj" />
								<ext:StringFilter DataIndex="countyadj" />
								<ext:StringFilter DataIndex="townadj" />
								<ext:StringFilter DataIndex="farmerpay" />
								<ext:StringFilter DataIndex="mzadj" />
								<ext:StringFilter DataIndex="collectadj" />
								<ext:StringFilter DataIndex="otheradj" />
								<ext:StringFilter DataIndex="sumjy" />
								<ext:StringFilter DataIndex="doorjy" />
								<ext:StringFilter DataIndex="hosjy" />
								<ext:StringFilter DataIndex="bigilljy" />
								<ext:StringFilter DataIndex="riskjy" />
								<ext:StringFilter DataIndex="yearjy" />
								<ext:StringFilter DataIndex="yeardoorjy" />
								<ext:StringFilter DataIndex="yearbigjy" />
								<ext:StringFilter DataIndex="yearhosjy" />
								<ext:StringFilter DataIndex="yearriskjy" />
								<ext:StringFilter DataIndex="lastyearsum" />
								<ext:StringFilter DataIndex="yearoutsum" />
								<ext:StringFilter DataIndex="state" />
								<ext:StringFilter DataIndex="dqbm" />

                                </Filters>
                            </ext:GridFilters>
                        </Plugins>
                        <LoadMask ShowMask="true" Msg="正在加载..." />
                        <SelectionModel>
                            <ext:CheckboxSelectionModel ID="CheckBoxGrid" runat="server" />
                        </SelectionModel>
                        <BottomBar>
                            <ext:PagingToolbar ID="PagingToolBar" StoreID="b00_zjmx_MainStore" PageSize="15" runat="server" />
                        </BottomBar>
                    </ext:GridPanel>
                </Items>
            </ext:FitLayout>
        </Items>
    </ext:Viewport>
    
    <!--b00_zjmx表修改，添加主窗体-->
    <ext:Window ID="b00_zjmx_Win" Collapsible="true" Hidden="true" Modal="true"
        Maximizable="true" runat="server" Title="添加/修改记录" Icon="WorldEdit" Width="630" AutoHeight="true"
        Resizable="true">
        <Items>
            <ext:Hidden ID="Hid" runat="server">
            </ext:Hidden>
            <ext:FormPanel ID="b00_zjmx_MainForm" LabelWidth="65" Frame="true" runat="server"
                Border="false" Height="420" Padding="5" Icon="UserAdd" Layout="Column">
                <Items>
                    <ext:Panel runat="server" Border="false" Header="false" ColumnWidth=".5" Layout="Form">
                        <Items>
                            
							<ext:TextField ID="Txtareacode" AnchorHorizontal="92%" runat="server" AllowBlank="false" EmptyText="该项不可为空" FieldLabel="AreaCode" />
							<ext:TextField ID="Txtraiseatub" AnchorHorizontal="92%" runat="server" AllowBlank="false" EmptyText="该项不可为空" FieldLabel="RaiseAtub" />
							<ext:TextField ID="Txtprovinceadj" AnchorHorizontal="92%" runat="server" AllowBlank="false" EmptyText="该项不可为空" FieldLabel="ProvinceAdj" />
							<ext:TextField ID="Txtcountyadj" AnchorHorizontal="92%" runat="server" AllowBlank="false" EmptyText="该项不可为空" FieldLabel="CountyAdj" />
							<ext:TextField ID="Txtfarmerpay" AnchorHorizontal="92%" runat="server" AllowBlank="false" EmptyText="该项不可为空" FieldLabel="FarmerPay" />
							<ext:TextField ID="Txtcollectadj" AnchorHorizontal="92%" runat="server" AllowBlank="false" EmptyText="该项不可为空" FieldLabel="CollectAdj" />
							<ext:TextField ID="Txtsumjy" AnchorHorizontal="92%" runat="server" AllowBlank="false" EmptyText="该项不可为空" FieldLabel="SumJY" />
							<ext:TextField ID="Txthosjy" AnchorHorizontal="92%" runat="server" AllowBlank="false" EmptyText="该项不可为空" FieldLabel="HosJy" />
							<ext:TextField ID="Txtriskjy" AnchorHorizontal="92%" runat="server" AllowBlank="false" EmptyText="该项不可为空" FieldLabel="RiskJY" />
							<ext:TextField ID="Txtyeardoorjy" AnchorHorizontal="92%" runat="server" AllowBlank="false" EmptyText="该项不可为空" FieldLabel="YearDoorJY" />
							<ext:TextField ID="Txtyearhosjy" AnchorHorizontal="92%" runat="server" AllowBlank="false" EmptyText="该项不可为空" FieldLabel="YearHosJy" />
							<ext:TextField ID="Txtlastyearsum" AnchorHorizontal="92%" runat="server" AllowBlank="false" EmptyText="该项不可为空" FieldLabel="LastYearSum" />
							<ext:TextField ID="Txtstate" AnchorHorizontal="92%" runat="server" AllowBlank="false" EmptyText="该项不可为空" FieldLabel="State" />

                        </Items>
                    </ext:Panel>
                    <ext:Panel runat="server" Border="false" Header="false" ColumnWidth=".5" Layout="Form">
                        <Items> 
                            
							<ext:TextField ID="Txtyearfen" AnchorHorizontal="92%" runat="server" AllowBlank="false" EmptyText="该项不可为空" FieldLabel="YearFen" />
							<ext:TextField ID="Txtcenteradj" AnchorHorizontal="92%" runat="server" AllowBlank="false" EmptyText="该项不可为空" FieldLabel="CenterAdj" />
							<ext:TextField ID="Txtcityadj" AnchorHorizontal="92%" runat="server" AllowBlank="false" EmptyText="该项不可为空" FieldLabel="CityAdj" />
							<ext:TextField ID="Txttownadj" AnchorHorizontal="92%" runat="server" AllowBlank="false" EmptyText="该项不可为空" FieldLabel="TownAdj" />
							<ext:TextField ID="Txtmzadj" AnchorHorizontal="92%" runat="server" AllowBlank="false" EmptyText="该项不可为空" FieldLabel="MZAdj" />
							<ext:TextField ID="Txtotheradj" AnchorHorizontal="92%" runat="server" AllowBlank="false" EmptyText="该项不可为空" FieldLabel="OtherAdj" />
							<ext:TextField ID="Txtdoorjy" AnchorHorizontal="92%" runat="server" AllowBlank="false" EmptyText="该项不可为空" FieldLabel="DoorJY" />
							<ext:TextField ID="Txtbigilljy" AnchorHorizontal="92%" runat="server" AllowBlank="false" EmptyText="该项不可为空" FieldLabel="BigIllJy" />
							<ext:TextField ID="Txtyearjy" AnchorHorizontal="92%" runat="server" AllowBlank="false" EmptyText="该项不可为空" FieldLabel="YearJY" />
							<ext:TextField ID="Txtyearbigjy" AnchorHorizontal="92%" runat="server" AllowBlank="false" EmptyText="该项不可为空" FieldLabel="YearBigJy" />
							<ext:TextField ID="Txtyearriskjy" AnchorHorizontal="92%" runat="server" AllowBlank="false" EmptyText="该项不可为空" FieldLabel="YearRiskJY" />
							<ext:TextField ID="Txtyearoutsum" AnchorHorizontal="92%" runat="server" AllowBlank="false" EmptyText="该项不可为空" FieldLabel="YearOutSum" />
							<ext:TextField ID="Txtdqbm" AnchorHorizontal="92%" runat="server" AllowBlank="false" EmptyText="该项不可为空" FieldLabel="dqbm" />

                        </Items>
                    </ext:Panel>
                </Items>
            </ext:FormPanel>
        </Items>
        <Buttons> 
            <ext:Button Text="提交" ID="BtnSave" runat="server" Icon="Disk">
                <DirectEvents>
                    <Click OnEvent="BtnSave_Click">
                        <EventMask ShowMask="true" Msg="正在提交，请等候 ..."  />
                    </Click>
                </DirectEvents>
                <Listeners>
                    <Click Handler="if (#{b00_zjmx_MainForm}.getForm().isValid()) {;}else{Ext.Msg.show({icon: Ext.MessageBox.ERROR, msg: '您填写的信息不正确，请您确认！', buttons:Ext.Msg.OK});return false;}" />
                </Listeners>
            </ext:Button>
            <ext:Button Text="取消" ID="BtnConcel" Icon="Delete">
                <Listeners>
                    <Click Handler="#{b00_zjmx_Win}.hide();" />
                </Listeners>
            </ext:Button>
        </Buttons>
    </ext:Window>
    </form>
</body>
</html>
